home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
ENET.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
4KB
|
149 lines
/*
File: ENET.h
Contains: Ethernet Interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __ENET__
#define __ENET__
#ifndef __TYPES__
#include <Types.h>
#endif
#ifndef __OSUTILS__
#include <OSUtils.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
enum {
ENetSetGeneral = 253, /*Set "general" mode*/
ENetGetInfo = 252, /*Get info*/
ENetRdCancel = 251, /*Cancel read*/
ENetRead = 250, /*Read*/
ENetWrite = 249, /*Write*/
ENetDetachPH = 248, /*Detach protocol handler*/
ENetAttachPH = 247, /*Attach protocol handler*/
ENetAddMulti = 246, /*Add a multicast address*/
ENetDelMulti = 245, /*Delete a multicast address*/
EAddrRType = 'eadr' /*Alternate address resource type*/
};
typedef struct EParamBlock EParamBlock;
typedef EParamBlock *EParamBlkPtr;
/*
This ProcPtr uses register based parameters on the 68k and cannot
be written in or called from a high-level language without the help of
mixed mode or assembly glue.
typedef pascal void (*ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);
*/
#if GENERATINGCFM
typedef UniversalProcPtr ENETCompletionUPP;
#else
typedef Register68kProcPtr ENETCompletionUPP;
#endif
struct EParamBlock {
QElem * qLink; /*General EParams*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ENETCompletionUPP ioCompletion; /*completion routine*/
OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*->filename*/
short ioVRefNum; /*volume reference or drive number*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
union {
struct {
short eProtType; /*Ethernet protocol type*/
Ptr ePointer; /*No support for PowerPC code*/
short eBuffSize; /*buffer size*/
short eDataSize; /*number of bytes read*/
} EParms1;
struct {
Byte eMultiAddr[6]; /*Multicast Address*/
} EParms2;
} u;
};
enum {
uppENETCompletionProcInfo = kRegisterBased
| REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(EParamBlkPtr)))
};
#if GENERATINGCFM
#define CallENETCompletionProc(userRoutine, thePBPtr) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppENETCompletionProcInfo, (thePBPtr))
#else
/* (*ENETCompletionUPP) cannot be called from a high-level language without the Mixed Mode Manager */
#endif
#if GENERATINGCFM
#define NewENETCompletionProc(userRoutine) \
(ENETCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppENETCompletionProcInfo, GetCurrentArchitecture())
#else
#define NewENETCompletionProc(userRoutine) \
((ENETCompletionUPP) (userRoutine))
#endif
extern pascal OSErr EWrite(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr EAttachPH(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr EDetachPH(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr ERead(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr ERdCancel(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr EGetInfo(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr ESetGeneral(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr EAddMulti(EParamBlkPtr thePBptr, Boolean async);
extern pascal OSErr EDelMulti(EParamBlkPtr thePBptr, Boolean async);
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __ENET__ */